<script setup>
import { reactive,ref } from "vue";

let homeData = reactive({
    big_classify:[
        {name:'美食',icon:'Food',color:'#409EFF'},
        {name:'甜点饮品',icon:'Dessert',color:'#CC33CC'},
        {name:'超市便利',icon:'ShoppingTrolley',color:'#F56C6C'},
        {name:'生鲜果蔬',icon:'Watermelon',color:'#E6A23C'},
        {name:'滴团买药',icon:'SuitcaseLine',color:'#67C23A'},
    ],
    small_classify:[
        {name:'午餐',icon:'Food',color:'#409EFF'},
        {name:'买酒',icon:'Dessert',color:'#F56C6C'},
        {name:'新鲜水果',icon:'ShoppingTrolley',color:'#E6A23C'},
        {name:'披萨汉堡',icon:'Watermelon',color:'#CC33CC'},
        {name:'休闲饮品',icon:'SuitcaseLine',color:'#67C23A'},
        {name:'午餐',icon:'Food',color:'#E6A23C'},
        {name:'买酒',icon:'Dessert',color:'#409EFF'},
        {name:'新鲜水果',icon:'ShoppingTrolley',color:'#67C23A'},
        {name:'披萨汉堡',icon:'Watermelon',color:'#F56C6C'},
        {name:'全部分类',icon:'Menu',color:'#606266'}
    ],
    nav_list:[
        {
            tab:'天天神券',
            data:[
                {
                    title:'酸菜鱼',
                    sales:'2888',
                    price:'20',
                    label:['门店上新','很下饭']
                },
                {
                    title:'酸菜鱼',
                    sales:'2888',
                    price:'20',
                    label:['门店上新','很下饭']
                },
                {
                    title:'酸菜鱼',
                    sales:'2888',
                    price:'20',
                    label:['门店上新','很下饭']
                },
                {
                    title:'酸菜鱼',
                    sales:'2888',
                    price:'20',
                    label:['门店上新','很下饭']
                }
            ]
        },
        {
            tab:'减配送费',
            data:[
                {
                    title:'酸菜鱼',
                    sales:'2888',
                    price:'20',
                    label:['门店上新','很下饭']
                },
                {
                    title:'酸菜鱼',
                    sales:'2888',
                    price:'20',
                    label:['门店上新','很下饭']
                },
                {
                    title:'酸菜鱼',
                    sales:'2888',
                    price:'20',
                    label:['门店上新','很下饭']
                },
                {
                    title:'酸菜鱼',
                    sales:'2888',
                    price:'20',
                    label:['门店上新','很下饭']
                }
            ]
        },
        {
            tab:'点评高分',
            data:[
                {
                    title:'酸菜鱼',
                    sales:'2888',
                    price:'20',
                    label:['门店上新','很下饭']
                },
                {
                    title:'酸菜鱼',
                    sales:'2888',
                    price:'20',
                    label:['门店上新','很下饭']
                },
                {
                    title:'酸菜鱼',
                    sales:'2888',
                    price:'20',
                    label:['门店上新','很下饭']
                },
                {
                    title:'酸菜鱼',
                    sales:'2888',
                    price:'20',
                    label:['门店上新','很下饭']
                }
            ]
        },
        {
            tab:'会员满减',
            data:[
                {
                    title:'酸菜鱼',
                    sales:'2888',
                    price:'20',
                    label:['门店上新','很下饭']
                },
                {
                    title:'酸菜鱼',
                    sales:'2888',
                    price:'20',
                    label:['门店上新','很下饭']
                },
                {
                    title:'酸菜鱼',
                    sales:'2888',
                    price:'20',
                    label:['门店上新','很下饭']
                },
                {
                    title:'酸菜鱼',
                    sales:'2888',
                    price:'20',
                    label:['门店上新','很下饭']
                }
            ]
        }
    ]
})

const activeIndex = ref('1')
</script>

<template>
<div class="home">
    <div class="home-content">
        <div class="home-header">
            <div class="text">外卖</div>
            <div class="location">
                <el-icon><LocationFilled /></el-icon>
                <span>地址</span>
                <el-icon><ArrowRightBold /></el-icon>
            </div>
        </div>

        <div class="main">
            <div class="main_bg">
                <div class="search">
                    <input type="text">
                    <div class="search_text">搜索</div>
                </div>
                <div class="classify">
                    <div class="big_classify">
                        <div v-for="item in homeData.big_classify" :key="item.name">
                            <el-icon class="classify_icon" :color="item.color">
                                <component :is="item.icon"></component>
                            </el-icon>
                            <span>{{ item.name }}</span>
                        </div>
                    </div>
                    <div class="small_classify">
                        <div v-for="item in homeData.small_classify" :key="item.name">
                            <el-icon class="classify_icon" :color="item.color">
                                <component :is="item.icon"></component>
                            </el-icon>
                            <span>{{ item.name }}</span>
                        </div>
                    </div>
                </div>
            </div>

            <div class="main_tabs">
                <ul>
                    <li>111</li>
                    <li>111</li>
                    <li>111</li>
                    <li>111</li>
                </ul>
            </div>
        </div>
    </div>
    <Footer />
</div>

</template>

<style lang="less" scoped>
.home {
    display: flex;
    flex-flow: column;
    height: 100%;
    font-size: 14px;
    .home-content {
        flex: 1;
        overflow-y: auto;
        .main {
            margin-top: -30px;
            .main_bg {
                background-image: linear-gradient(to bottom, #fff, #f5f5f5);
                padding: 10px 20px 0 20px;
                border-radius: 30px 30px 0 0;
                position: relative;
                .search {
                    position: relative;
                    .search_text {
                        position: absolute;
                        background-color: #ffc400;
                        right: -6px;
                        top: 1px;
                        width: 50px;
                        height: 32.5px;
                        border-radius: 16px;
                        text-align: center;
                        line-height: 32px;
                        font-size: 14px;
                    }
                    input{
                        position: absolute;
                        width: 100%;
                        border: 1px solid #ffc400;
                        border-radius: 20px;
                        height: 30px;
                    }
                }
                .classify {
                    padding-top: 50px;
                    .big_classify{
                        display: flex;
                        div{
                            flex: 1;
                            display: flex;
                            flex-direction: column;
                            justify-content: center;
                            align-items: center;
                            .classify_icon {
                                width: 50px;
                                height: 50px;
                                margin-bottom: 5px;
                                font-size: 40px;
                            }
                        }
                    }
                    .small_classify{
                        display: flex;
                        flex-wrap: wrap;
                        margin-top: 20px;
                        div{
                            display: flex;
                            flex-direction: column;
                            justify-content: center;
                            align-items: center;
                            width: 20%;
                            .classify_icon {
                                width: 30px;
                                height: 30px;
                                margin-bottom: 5px;
                                font-size: 30px;
                            }
                        }
                    }
                }
            }
            .main_tabs {
                width: calc(100% - 20px);
                margin: 0 auto;
                ul {
                    background-color: #fff;
                    height: 35px;
                    padding: 0 20px 10px;
                    border-radius: 10px;
                    display: flex;
                    line-height: 24px;
                    li {
                        flex: 1;
                        text-align: center;
                        
                    }
                }
                
                
            }
        }
    }
    .home-header {
        background-image: linear-gradient(to bottom, #ffc400, #fff);
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px 20px 40px 20px;
        .text {
            font-size: 20px;
            font-weight: 600;
        }
        .location {
            span{
                margin: 0 5px;
            }
            font-size: 14px;
        }
    }
}
</style>
